package com.stars.dao.mapper.system;

import com.stars.entity.sys.SystemPermissionRelation;
import tk.mybatis.mapper.common.Mapper;

public interface SystemPermissionRelationMapper extends Mapper<SystemPermissionRelation> {

    /**
     * 查询是否存在重复记录
     *
     * @param systemPermissionRelation
     * @return
     * @throws Exception
     */
    SystemPermissionRelation findByRelation(SystemPermissionRelation systemPermissionRelation) throws Exception;

    /**
     * 根据角色Id和资源id       删除关系
     *
     * @throws Exception
     */
    void deleteByRoleIdAndPerId(SystemPermissionRelation systemPermissionRelation) throws Exception;

    /**
     * 根据角色id删除该角色的对应用户的关系
     *
     * @param roleId
     * @throws Exception
     */
    void deleteByRoleId(String roleId) throws Exception;
}